﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.YG
{
    /// <summary>
    /// 阳光人寿阳光宝贝终身寿险（分红型）
    /// </summary>
    class Class10
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故"))
            {

                if (ppa.Age < 18)
                {
                    double s = 0f;
                    for (int i = 0; i <ppa.PolicyActing.Policy.PaymentPeriodLength; i++)
                    {
                        s += ppa.TotalFee * 1.025;
                    }
                    da.Value = s;
                }
                else
                {
                    da.Value = ppa.Amount * 3;
                }

                ppa.IsCurrentFinish = true;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period > 0 && (ppa.Period + 1) % 3 == 0)
            {
                da.Value = ppa.Amount * 0.15;
            }
        }
    }
}
